package com.mask.sca.core;


import com.mask.sca.core.entity.CurrentUserInfo;

public class UserContextHolder {
    private static final ThreadLocal<CurrentUserInfo> userContext = new ThreadLocal<>();

    public static void setCurrentUser(CurrentUserInfo userInfo) {
        userContext.set(userInfo);
    }

    public static CurrentUserInfo getCurrentUser() {
        return userContext.get();
    }

    public static void clear() {
        userContext.remove();
    }
}